for i in range(1, 10):
    for j in range(1, i + 1):
        print("{}*{}={:<4}".format(j, i, j * i), end="")
    print()
print("=" * 80)

for i in range(9, 0, -1):
    for j in range(1, i + 1):
        print("{}*{}={:<4}".format(j, i, j * i), end="")
    print()

print()
print()
print("=" * 80)

for i in range(1, 10):  # 外层循环

    # 循环来加空格
    for m in range(1, 10 - i):
        print(end="         ")

    # 循环来计算并格式化输出
    for j in range(i, 0, -1):
        print("{:}*{:}={:<4}".format(j, i, j * i), end=" ")

    print("")

print("=" * 80)

for i in range(9, 0, -1):  # 外层循环

    # 循环来加空格
    for m in range(1, 10 - i):
        print(end="         ")
    # 循环来计算并格式化输出

    for j in range(i, 0, -1):
        print("{:}*{:}={:<4}".format(j, i, j * i), end=" ")

    print("")
